<?php
namespace app\com\simtoon\log;

use Yii;
use app\com\simtoon\comm\Common;


defined('TRANSACTION_ID') or define('TRANSACTION_ID',Common::getMicrotimeWithInt().rand(10000,99999));
/**
 * 日志类
 */
class LogUtils
{

	/**
	 * 信息日志
	 * @param string $_message 日志信息
	 */
	public static function info($_message, $level)
	{
		Yii::info("[Transaction_Id:".TRANSACTION_ID."][" .$_message. "]", $level);
	}
	
	/**
	 * 错误日志
	 * @param string $_message 日志信息
	 */
	public static function error($_message, $level)
	{
		Yii::error("[Transaction_Id:".TRANSACTION_ID."][" .$_message. "]", $level);
	}
	
	/**
	 * 警告日志
	 * @param string $_message 日志信息
	 */
	public static function warn($_message, $level)
	{
		Yii::warning("[Transaction_Id:".TRANSACTION_ID."][" .$_message. "]", $level);
	}
	
	public static function getTRansactionId()
	{
		return TRANSACTION_ID;
	}

	

}